#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
#include "proclib.h"

int main(int argc, char *argv[]) {
    pid_t pid;
    pid = fork();
    int status;
    if (pid < 0) {
        printf("error when fork\n");
        exit(EXIT_FAILURE);
    }
    if (pid == 0) {
        /* Child */
        // exit(66);
        // abort();
        int wrong = 1 / 0;
    } else {
        /* Parent */
        pid_t child_p = wait(&status);
        pr_exit(child_p, status);
    }
    return EXIT_SUCCESS;
}
